<?php
$T->loadTpl("./html/".$template."/".$qname.".html");
$T->SetTpl('cssjs','html/cssjs.inc'); 
$T->SetTpl('jsmodel','html/jsmodel.inc');     
 
$p=isset($_GET["p"])?$_GET["p"]:"1";
$s_name=isset($_GET["s_name"])?$_GET["s_name"]:"";
$s_where="";
if(!empty($s_name)){
    $s_where=" and username like '%".$s_name."%'";
}
if($p<1)$p=1;

if(!ckAdm()){
    $s_where=" and school=".$_SESSION["school"]." ";
}

$rc=$T->db->query("select count(*) from sys_member where 1=1 ".$s_where)->fetchColumn(0);
$page=getPageHtml_bt($rc,15,$p,"&t=user_sys&s_name=".$s_name);
$page=mb_convert_encoding($page, 'utf-8', 'utf-8');
$T->Set("s_name",$s_name);
$T->Set("page",$page);
$sql="select a.*,b.name as idtypename,c.sch_name,d.rolename,e.name as dutytitlename,f.name as nationname from sys_member a left join sys_dict b on a.idtype=b.id left join sys_school c on a.school=c.id left join sys_role d on ";
$sql=$sql." a.role=d.id left join sys_dict e on a.dutytitle=e.id left join sys_dict f on a.nation=f.id where 1=1 ".$s_where." order by a.id desc limit ".(($p-1)*15).",15";
$T->SetBlock("list",$sql);
             

$T->Set("template",$template);         
$T->clearNaN();       
$T->clearNoN();
$T->display(); 